import 'package:flutter/material.dart';

class FloatingActionButtonDemo extends StatelessWidget {
  
  final Widget _floatingActionButton = FloatingActionButton(
    onPressed: () {},
    child: Icon(Icons.add), // 图标默认颜色是主题中设置的
    elevation: 0.0, // 设置与下一层之间的高度，0.0 按钮阴影效果消失
    backgroundColor: Colors.pink, // 设置自定义的背景颜色
    // shape: BeveledRectangleBorder(
    //   borderRadius: BorderRadius.circular(4.0), // 设置圆角边框效果
    // ), // 设置按钮的形状
  );

  final Widget _floatingActionButtonExtended = FloatingActionButton.extended(
    onPressed: () {}, 
    icon: Icon(Icons.add),
    label: Text("Add"),
  );

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("FloatingActionButtonDemo"),
        elevation: 0.0,
      ),
      // floatingActionButton: _floatingActionButtonExtended,
      floatingActionButton: _floatingActionButton,
      floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
      bottomNavigationBar: BottomAppBar(
        child: Container(
          height: 80.0,
        ),
        shape: CircularNotchedRectangle(),
      ),
    );
  }
}